package org.reservation.interceptor;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts2.StrutsStatics;

import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.interceptor.AbstractInterceptor;

public class UnicodInterceptor extends AbstractInterceptor{

	@Override
	public String intercept(ActionInvocation arg0) throws Exception {
		// TODO Auto-generated method stub
		ActionContext actionContext=arg0.getInvocationContext();
		HttpServletRequest request=(HttpServletRequest) actionContext.get(StrutsStatics.HTTP_REQUEST);
		request.setCharacterEncoding("utf-8");
		HttpServletResponse response=(HttpServletResponse) actionContext.get(StrutsStatics.HTTP_RESPONSE);
		response.setCharacterEncoding("utf-8");
		return arg0.invoke();
	}

}
